/*
 * SarsPacketMessage.cs
 * Definiton of SARS Packet Message object.
 * This class generates a packet's payload and
 * generates a payload - object mapping from
 * raw payload data.
 */

using System;
using System.Collections.Generic;


namespace LibSars
{
	// Abstract class SarsPacketMessage.
	// An SarsPacketMessage implements methods for payload generation
	// and regeneration of message objects from raw payloads.
	public abstract class SarsPacketMessage {
		// Generate payload.
		public abstract byte[] GeneratePayloadBytes();
		// Get decimal identifier (message typ) for content.
		public abstract UInt16 GetMTypeInt();
		// Parse payload
		public abstract void FromBytes(ref byte[] bytes);
		// Clone object.
		public SarsPacketMessage Clone(){
			return (SarsPacketMessage)this.MemberwiseClone();
	    }
	}
}
